<template>
    <RouterView></RouterView>
</template>

<script lang="ts" setup>
import { useAppStore } from "@/store/modules/app";
import { CACHE_KEY, useCache } from "@/hooks/useCache";

const appStore = useAppStore();
const { wsCache } = useCache();

// 根据浏览器当前主题设置系统主题色
const setDefaultTheme = () => {
    let isDarkTheme = wsCache.get(CACHE_KEY.IS_DARK);
    if (isDarkTheme === null) {
        isDarkTheme = false;
    }
    console.log(isDarkTheme);
    appStore.setIsDark(isDarkTheme);
};


setDefaultTheme();

</script>

<style>
@import "@/index.css";
html,
body {
    margin: 0;
    padding: 0;
}
#app {
    /* width: 100vw; */
    height: 100vh;
}
</style>